
const _VIEW_PANE_SUFFIX_ = 'view';
const _EDIT_PANE_SUFFIX_ = 'edit';

const _mapPaneClass = new Map();
export default Object.freeze({
    RegistPane: function (widgetType, viewPaneCls, editPaneCls) {
        _mapPaneClass.set(`${widgetType}_${_VIEW_PANE_SUFFIX_}`, viewPaneCls);
        _mapPaneClass.set(`${widgetType}_${_EDIT_PANE_SUFFIX_}`, editPaneCls);
    },
    CreateViewPane: function (widgetType, widgetContent) {
        const _cls = _mapPaneClass.get(`${widgetType}_${_VIEW_PANE_SUFFIX_}`);
        return new _cls(widgetContent);
    },
    CreateEditPane: function (widgetType, widgetContent) {
        const _cls = _mapPaneClass.get(`${widgetType}_${_EDIT_PANE_SUFFIX_}`);
        return new _cls(widgetContent);
    }
});


